package cn.wolfcode.p2p.controller;

import cn.wolfcode.p2p.base.annotation.IsLoginAnno;
import cn.wolfcode.p2p.base.query.IpLogQuery;
import cn.wolfcode.p2p.base.service.IIpLogService;
import cn.wolfcode.p2p.util.JSONResult;
import cn.wolfcode.p2p.util.PageResult;
import cn.wolfcode.p2p.util.UserContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class IpLogController {
        @Autowired
        private IIpLogService iIpLogService;

        @RequestMapping("ipLog")
        @IsLoginAnno
        public String list(@ModelAttribute("qo")IpLogQuery qo, Model model){
                qo.setUsername(UserContext.getLoginInfo().getUsername());
                PageResult pageResult = iIpLogService.query(qo);
                model.addAttribute("pageResult",pageResult);
                return "iplog_list";
        }



}
